﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using WEB.Utils;

namespace WEB.Model.Service.Sysconfig
{
    public class Sysconfig
    {
        private static DataAccess da = new DataAccess();
        public Sysconfig() { }
        /// <summary>
        /// 获得系统配置的值
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static string getValueByKey(string key)
        {
            string reVal = "";
            string sql = "select * from sysconfig where [syskey]='" + key + "'";
            SqlDataReader reader = da.getReader(sql);
            if (reader.HasRows)
            {
                reader.Read();
                reVal = reader["sysvalue"].ToString();
            }
            else
            {
            }
            reader.Close();
            return reVal;
        }
    }
}